import Vue from 'vue';

import App from './App.vue';

import vueRouter from 'vue-router'

import MintUI from 'mint-ui'

import vueResource from 'vue-resource';

Vue.use(vueResource);
Vue.use(vueRouter);
Vue.use(MintUI);

import newList from './component/news/newList.vue';
import goodList from './component/goods/goodList.vue';
import  photoList from './component/photo/photoList.vue';
import newsinfo from './component/news/newsinfo.vue';

//定义路由规则
import home from './component/home.vue';
import shopcar from './component/shopcar/car.vue';
import 'mint-ui/lib/style.css';
import '../statics/mui/css/mui.css';
import '../statics/css/site.css';
var router=new vueRouter({
    linkActiveClass:'mui-active',
    routes:[
        {path:'/',redirect:'/home'},
        {path:'/home',component:home},
        {path:'/shopcar',component:shopcar},
        {path:'/news/newsList',component:newList},
        {path:'/photo/photoList',component:photoList},
        {path:'/goods/goodsList',component:goodList},
        {path:'/news/newsinfo/:id',component:newsinfo},

    ]
})
//定义一个全局的过滤器
import moment from 'moment'
Vue.filter('datafmt',function (input,fmtstring) {
    return moment(input).format(fmtstring);
})
new Vue({
    el:'#app',
    router:router,
    render:create=>create(App)
})